<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SkyGameEngine2d: SkyEngine2d::EventManager类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="shpe.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SkyGameEngine2d
   &#160;<span id="projectnumber">1.0.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>SkyEngine2d</b></li><li class="navelem"><a class="el" href="class_sky_engine2d_1_1_event_manager.html">EventManager</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#friends">友元</a> &#124;
<a href="class_sky_engine2d_1_1_event_manager-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">SkyEngine2d::EventManager类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>标准事件管理器  
 <a href="class_sky_engine2d_1_1_event_manager.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_event_manager_8h_source.html">EventManager.h</a>&gt;</code></p>
<div class="dynheader">
类 SkyEngine2d::EventManager 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_sky_engine2d_1_1_event_manager.png" usemap="#SkyEngine2d::EventManager_map" alt=""/>
  <map id="SkyEngine2d::EventManager_map" name="SkyEngine2d::EventManager_map">
<area href="class_sky_engine2d_1_1_singleton.html" alt="SkyEngine2d::Singleton&lt; EventManager, false &gt;" shape="rect" coords="0,56,287,80"/>
<area href="class_sky_engine2d_1_1_non_copyable.html" title="不可拷贝对象的基类" alt="SkyEngine2d::NonCopyable" shape="rect" coords="0,0,287,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a16a6ca5086baf7c08f1f8114b65f479f"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479f">TriggerMode</a> { <a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479fa7caa701b2bd5a182b80c72b9bdf88e2d">TriggerMode::direct</a>, 
<a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479faa9d1cbf71942327e98b40cf5ef38a960">TriggerMode::queue</a>
 }</td></tr>
<tr class="memdesc:a16a6ca5086baf7c08f1f8114b65f479f"><td class="mdescLeft">&#160;</td><td class="mdescRight">事件的触发模式  <a href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479f">更多...</a><br /></td></tr>
<tr class="separator:a16a6ca5086baf7c08f1f8114b65f479f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ad685af481c8293c2883302aeb23f321e"><td class="memItemLeft" align="right" valign="top"><a id="ad685af481c8293c2883302aeb23f321e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sky_engine2d_1_1_event_manager.html#ad685af481c8293c2883302aeb23f321e">~EventManager</a> ()</td></tr>
<tr class="memdesc:ad685af481c8293c2883302aeb23f321e"><td class="mdescLeft">&#160;</td><td class="mdescRight">析构函数 <br /></td></tr>
<tr class="separator:ad685af481c8293c2883302aeb23f321e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac303a7f1ec47d1f784080ae465588dde"><td class="memTemplParams" colspan="2">template&lt;typename EventType &gt; </td></tr>
<tr class="memitem:ac303a7f1ec47d1f784080ae465588dde"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="class_sky_engine2d_1_1_event_listener_handle.html">EventListenerHandle</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_sky_engine2d_1_1_event_manager.html#ac303a7f1ec47d1f784080ae465588dde">addListener</a> (const std::function&lt; void(<a class="el" href="class_sky_engine2d_1_1_event.html">Event</a> *e)&gt; &amp;listener)</td></tr>
<tr class="memdesc:ac303a7f1ec47d1f784080ae465588dde"><td class="mdescLeft">&#160;</td><td class="mdescRight">添加事件处理  <a href="#ac303a7f1ec47d1f784080ae465588dde">更多...</a><br /></td></tr>
<tr class="separator:ac303a7f1ec47d1f784080ae465588dde"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f2d3da19e2fed6b996e812c0ccddb82"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sky_engine2d_1_1_event_manager.html#a0f2d3da19e2fed6b996e812c0ccddb82">removeListener</a> (const <a class="el" href="class_sky_engine2d_1_1_event_listener_handle.html">EventListenerHandle</a> &amp;handle)</td></tr>
<tr class="memdesc:a0f2d3da19e2fed6b996e812c0ccddb82"><td class="mdescLeft">&#160;</td><td class="mdescRight">移除事件监听器  <a href="#a0f2d3da19e2fed6b996e812c0ccddb82">更多...</a><br /></td></tr>
<tr class="separator:a0f2d3da19e2fed6b996e812c0ccddb82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d6862af55b86acf2f2e67ea6d454f8d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sky_engine2d_1_1_event_manager.html#a9d6862af55b86acf2f2e67ea6d454f8d">triggerEvent</a> (const std::shared_ptr&lt; <a class="el" href="class_sky_engine2d_1_1_event.html">Event</a> &gt; &amp;e, <a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479f">TriggerMode</a> mode=<a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479fa7caa701b2bd5a182b80c72b9bdf88e2d">TriggerMode::direct</a>)</td></tr>
<tr class="memdesc:a9d6862af55b86acf2f2e67ea6d454f8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">触发一个事件  <a href="#a9d6862af55b86acf2f2e67ea6d454f8d">更多...</a><br /></td></tr>
<tr class="separator:a9d6862af55b86acf2f2e67ea6d454f8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_sky_engine2d_1_1_non_copyable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_sky_engine2d_1_1_non_copyable')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="class_sky_engine2d_1_1_non_copyable.html">SkyEngine2d::NonCopyable</a></td></tr>
<tr class="memitem:a570a18a8e326ce10a33915dffdc2b23e inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memItemLeft" align="right" valign="top"><a id="a570a18a8e326ce10a33915dffdc2b23e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>NonCopyable</b> (const <a class="el" href="class_sky_engine2d_1_1_non_copyable.html">NonCopyable</a> &amp;)=delete</td></tr>
<tr class="separator:a570a18a8e326ce10a33915dffdc2b23e inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac21e0c7e1d6da8e9a27f6b6d8087e46a inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memItemLeft" align="right" valign="top"><a id="ac21e0c7e1d6da8e9a27f6b6d8087e46a"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>NonCopyable</b> (<a class="el" href="class_sky_engine2d_1_1_non_copyable.html">NonCopyable</a> &amp;&amp;)=delete</td></tr>
<tr class="separator:ac21e0c7e1d6da8e9a27f6b6d8087e46a inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fdd4955d223d165a4fbe84f5c4690b5 inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memItemLeft" align="right" valign="top"><a id="a9fdd4955d223d165a4fbe84f5c4690b5"></a>
<a class="el" href="class_sky_engine2d_1_1_non_copyable.html">NonCopyable</a>&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="class_sky_engine2d_1_1_non_copyable.html">NonCopyable</a> &amp;)=delete</td></tr>
<tr class="separator:a9fdd4955d223d165a4fbe84f5c4690b5 inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1397ae519173378b37ad622d148be3b5 inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memItemLeft" align="right" valign="top"><a id="a1397ae519173378b37ad622d148be3b5"></a>
<a class="el" href="class_sky_engine2d_1_1_non_copyable.html">NonCopyable</a>&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="class_sky_engine2d_1_1_non_copyable.html">NonCopyable</a> &amp;&amp;)=delete</td></tr>
<tr class="separator:a1397ae519173378b37ad622d148be3b5 inherit pub_methods_class_sky_engine2d_1_1_non_copyable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
友元</h2></td></tr>
<tr class="memitem:a64295fb3febef7bf3fe34ef528961205"><td class="memItemLeft" align="right" valign="top"><a id="a64295fb3febef7bf3fe34ef528961205"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>GameWorld</b></td></tr>
<tr class="separator:a64295fb3febef7bf3fe34ef528961205"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pub_static_methods_class_sky_engine2d_1_1_singleton"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_class_sky_engine2d_1_1_singleton')"><img src="closed.png" alt="-"/>&#160;静态 Public 成员函数 继承自 <a class="el" href="class_sky_engine2d_1_1_singleton.html">SkyEngine2d::Singleton&lt; EventManager, false &gt;</a></td></tr>
<tr class="memitem:a0cc2c840da44a8cb0784ae398215f921 inherit pub_static_methods_class_sky_engine2d_1_1_singleton"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_sky_engine2d_1_1_event_manager.html">EventManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sky_engine2d_1_1_singleton.html#a0cc2c840da44a8cb0784ae398215f921">getInstance</a> ()</td></tr>
<tr class="memdesc:a0cc2c840da44a8cb0784ae398215f921 inherit pub_static_methods_class_sky_engine2d_1_1_singleton"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取单例对象的实例  <a href="class_sky_engine2d_1_1_singleton.html#a0cc2c840da44a8cb0784ae398215f921">更多...</a><br /></td></tr>
<tr class="separator:a0cc2c840da44a8cb0784ae398215f921 inherit pub_static_methods_class_sky_engine2d_1_1_singleton"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>标准事件管理器 </p>
</div><h2 class="groupheader">成员枚举类型说明</h2>
<a id="a16a6ca5086baf7c08f1f8114b65f479f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16a6ca5086baf7c08f1f8114b65f479f">&#9670;&nbsp;</a></span>TriggerMode</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479f">SkyEngine2d::EventManager::TriggerMode</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>事件的触发模式 </p>
<table class="fieldtable">
<tr><th colspan="2">枚举值</th></tr><tr><td class="fieldname"><a id="a16a6ca5086baf7c08f1f8114b65f479fa7caa701b2bd5a182b80c72b9bdf88e2d"></a>direct&#160;</td><td class="fielddoc"><p>直接触发. 直接触发模式会在触发事件时立即回调事件处理 </p>
</td></tr>
<tr><td class="fieldname"><a id="a16a6ca5086baf7c08f1f8114b65f479faa9d1cbf71942327e98b40cf5ef38a960"></a>queue&#160;</td><td class="fielddoc"><p>队列触发. 队列触发模式会在触发事件时将事件加入事件队列中 </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="ac303a7f1ec47d1f784080ae465588dde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac303a7f1ec47d1f784080ae465588dde">&#9670;&nbsp;</a></span>addListener()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename EventType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_sky_engine2d_1_1_event_listener_handle.html">EventListenerHandle</a> SkyEngine2d::EventManager::addListener </td>
          <td>(</td>
          <td class="paramtype">const std::function&lt; void(<a class="el" href="class_sky_engine2d_1_1_event.html">Event</a> *e)&gt; &amp;&#160;</td>
          <td class="paramname"><em>listener</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>添加事件处理 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">const</td><td>std::function&lt;void Event * e &gt; &amp; listener 事件监听器 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><a class="el" href="class_sky_engine2d_1_1_event_listener_handle.html" title="标准事件监听器的句柄">EventListenerHandle</a> 事件监听器的句柄 </dd></dl>

</div>
</div>
<a id="a0f2d3da19e2fed6b996e812c0ccddb82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f2d3da19e2fed6b996e812c0ccddb82">&#9670;&nbsp;</a></span>removeListener()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SkyEngine2d::EventManager::removeListener </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_sky_engine2d_1_1_event_listener_handle.html">EventListenerHandle</a> &amp;&#160;</td>
          <td class="paramname"><em>handle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>移除事件监听器 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">const</td><td><a class="el" href="class_sky_engine2d_1_1_event_listener_handle.html" title="标准事件监听器的句柄">EventListenerHandle</a> &amp; handle 事件监听器句柄 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>void </dd></dl>

</div>
</div>
<a id="a9d6862af55b86acf2f2e67ea6d454f8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d6862af55b86acf2f2e67ea6d454f8d">&#9670;&nbsp;</a></span>triggerEvent()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SkyEngine2d::EventManager::triggerEvent </td>
          <td>(</td>
          <td class="paramtype">const std::shared_ptr&lt; <a class="el" href="class_sky_engine2d_1_1_event.html">Event</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>e</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479f">TriggerMode</a>&#160;</td>
          <td class="paramname"><em>mode</em> = <code><a class="el" href="class_sky_engine2d_1_1_event_manager.html#a16a6ca5086baf7c08f1f8114b65f479fa7caa701b2bd5a182b80c72b9bdf88e2d">TriggerMode::direct</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>触发一个事件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">const</td><td>std::shared_ptr&lt;Event&gt;&amp; e 事件指针 </td></tr>
    <tr><td class="paramname">TriggerMode</td><td>mode 触发模式 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>void </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>C:/code/SkyGameEngine2d/src/base/<a class="el" href="_event_manager_8h_source.html">EventManager.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
